package com.hzncc.flowable_diboot.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.diboot.core.entity.BaseModel;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
* 商机 Entity 定义
* @author MyName
* @version 1.0
* @date 2024-06-14
* Copyright © MyCorp
*/

@TableName("mdl_business")
@Getter @Setter @Accessors(chain = true)
public class Business extends BaseModel {
    private static final long serialVersionUID = 1701231153819139808L;

    /**
     * 租户
     */
    @NotNull(message = "租户不能为空")
    @TableField()
    private String tenantId;

    /**
     * 商机名称
     */
    @Length(max=100, message="商机名称长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String name;

    /**
     * 商机编号
     */
    @Length(max=100, message="商机编号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String code;

    /**
     * 客户id
     */
    @TableField()
    private String customerId;

    /**
     * 最后跟进时间
     */
    @TableField()
    private LocalDateTime lastFollowUpTime;

    /**
     * 负责人
     */
    @TableField()
    private String uid;

    /**
     * 相关团队
     */
    @Length(max=100, message="相关团队长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String relatedTeam;

    /**
     * 商机阶段
     */
    @Length(max=100, message="商机阶段长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String stage;

    /**
     * 产品
     */
    @TableField()
    private String production;

    /**
     * 关注人
     */
    @TableField(exist = false)
    private List<String> starUids;

    /**
     * 模板id
     */
    @TableField()
    private String flowTemplateId;

    /**
     * 流程状态
     */
    @TableField()
    private String status;

    /**
     * 流程单id
     */
    @TableField()
    private String orderId;

    /**
     * 赢单状态
     */
    @TableField()
    private String winType;

    /**
     * 办事处
     */
    @TableField()
    private String officeId;


}